package cn.jiyun.controller;

import cn.jiyun.common.config.Result;
import cn.jiyun.entity.Yjqj;
import cn.jiyun.service.YjqjService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.servlet.http.HttpServletRequest;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;

@RestController
@RequestMapping("/yjqj")
@CrossOrigin
public class YjqjController {
    @Autowired
    private YjqjService yjqjService;


    @RequestMapping("/findPage")
    public Result findPage(Integer pageNum, Integer pageSize,@RequestBody Yjqj yjqj) {
        Page<Yjqj> yjqjPage = yjqjService.findPage(pageNum, pageSize,yjqj);
        return Result.ok(yjqjPage);
    }
    @RequestMapping("/findId")
    public Result findId(Integer id) {
        Yjqj yjqj=yjqjService.findId(id);
        return Result.ok(yjqj);
    }


}
